const path = require("path");
const pkg = require("./package.json");

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: "",   //项目部署的地址(前面是www.服务器.com)拼接这里的地址，也就是说静态资源从这里找
  outputDir:  process.env.NODE_ENV==="production"?`dist/${pkg.name}_${process.env.VUE_APP_PlATFORM}_${process.env.NODE_ENV}`
  :`dist/${pkg.name}_${process.env.VUE_APP_PlATFORM}`,    //build打包之后的文件夹名称
  assetsDir: "./",        //打包之后的静态资源的相对于outputDir的位置
  runtimeCompiler: undefined,
  productionSourceMap: false,
  parallel: undefined,
  devServer: {
    proxy: {
      "/dcxt": {
        target: "http://www.baidu.com:8085", 
        changeOrigin: true 
      }
    },
    hot: true,
    open: true,
    host: "localhost", 
    port: 3000,
    before: require('./mock/mock-server.js')
  },
  chainWebpack: (config)=>{
    config.resolve.alias
      .set('@', path.join(__dirname,'src'))
      .set('components', path.join(__dirname,'src/components'))
      .set('mixins', path.join(__dirname,'src/mixins'))
      .set('store', path.join(__dirname,'src/store'))
  },
};
